package com.yhp.bo;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.util.Date;

//使用hibernate-validate做数据校验
public class CenterUserBO {

    @NotBlank(message = "用户昵称不能为空")
    @Length(max =12,message = "用户昵称不能超过12位")
    private String nickname;
    private String realname;
    @Pattern(regexp = "^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\\d{8})$",message = "手机号格式不正确")
    private String mobile;
    @Email
    private String email;
    @Min(value = 0,message = "性别选择不正确")
    @Max(value = 1,message = "性别选择不正确")
    //注意:如果页面给的性别值是小数，如2.9,程序会自动强制转换成整数值
    private Integer sex;
    private Date birthday;

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}
